import 'package:flutter/material.dart';

class AccountPasswordLogin extends StatelessWidget {
  const AccountPasswordLogin({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 80),
        child: Column(
          children: [
            // 标题
            Text('京东商城', style: TextStyle(fontSize: 70)),
            SizedBox(height: 20),
            Text('密码登录', style: TextStyle(fontSize: 30)),
            SizedBox(height: 20),
            // 输入框
            TextField(
              controller: TextEditingController(),
              // 文本控制器:ml-citation{ref="1,2" data="citationList"}
              decoration: InputDecoration(
                hintText: "请输入手机号",
                // 提示文本:ml-citation{ref="5,6" data="citationList"}
                border: UnderlineInputBorder(
                  borderSide: BorderSide(color: Colors.grey, width: 1.0),
                ),
                // 默认下边框样式:ml-citation{ref="6,8" data="citationList"}
                enabledBorder: UnderlineInputBorder(
                  borderSide: BorderSide(color: Colors.grey, width: 1.0),
                ),
                // 未聚焦时的下边框:ml-citation{ref="8" data="citationList"}
                focusedBorder: UnderlineInputBorder(
                  borderSide: BorderSide(color: Colors.grey, width: 1.0),
                ), // 聚焦时的下边框:ml-citation{ref="8" data="citationList"}
              ),
              onChanged: (value) {
                print(
                  value,
                ); // 监听输入变化:ml-citation{ref="1,3" data="citationList"}
              },
            ),
            SizedBox(height: 20),
            // 输入框
            Container(
              decoration: BoxDecoration(
                border: Border(
                  bottom: BorderSide(
                    color: Colors.grey, // 边框颜色
                    width: 1.0, // 边框宽度
                  ),
                ),
              ),
              child: Row(
                children: [
                  Expanded(
                    child: TextField(
                      controller: TextEditingController(),
                      // 文本控制器:ml-citation{ref="1,2" data="citationList"}
                      decoration: InputDecoration(
                        hintText: "请输入验证码",
                        // 设置无边框样式
                        border: InputBorder.none,
                        enabledBorder: InputBorder.none,
                        focusedBorder: InputBorder.none,
                      ),
                      onChanged: (value) {
                        print(
                          value,
                        ); // 监听输入变化:ml-citation{ref="1,3" data="citationList"}
                      },
                    ),
                  ),
                  Text('获取验证码'),
                ],
              ),
            ),
            SizedBox(height: 30),
            // 登录按钮
            GestureDetector(
              onTap: () {
                Navigator.pushNamed(context, '/');
              },
              child: Container(
                width: MediaQuery.of(context).size.width,
                height: 50,
                decoration: BoxDecoration(
                  color: Colors.red,
                  borderRadius: BorderRadius.circular(30),
                ),
                alignment: Alignment.center,
                child: Text(
                  '密码登录',
                  style: TextStyle(color: Colors.white, fontSize: 20),
                ),
              ),
            ),
            SizedBox(height: 30),
            // 文字 左右
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                TextButton(
                  onPressed: () {
                    Navigator.pushNamed(context, '/account/sms_login');
                  },
                  child: Text('短信登录'),
                ),

                TextButton(
                  onPressed: () {
                    Navigator.pushNamed(context, '/account/sms_registry');
                  },
                  child: Text('短信注册'),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
